package Day9.ATM;

public class AccoutManger {
	private Double balane;
	private int num;
	
	
	public void cunqian(Double money) {
		balane += money;
		this.balane = balane;
	}
	
	public void quqian(Double money) throws NoMoneyException {
		if (balane > money) {
			balane -= money;
			this.balane = balane;
			System.out.println("您已取钱成功，余额为"+this.balane);
		}else {
			Double needMonry = money - balane;
			
			throw new NoMoneyException(needMonry);
		}
	}
	
	public AccoutManger() {
		super();
		// TODO Auto-generated constructor stub
	}
	public AccoutManger(Double balane, int num) {
		super();
		this.balane = balane;
		this.num = num;
	}
	
	
}
